import {
  log_mongoDB,
  type_mongoDB,
} from '../../../../../../../../conect_mongoDB_class_laugh_node';
import { get_path_log_db_cur_user } from '../../../../user/Func/Log_info/Func/get_log_db_cur_user';
import {
  prop_type_target_id,
  req_info_type,
} from '../../../Classes/cla_req_info_type';
import { spacename_type } from '../../../DataDefine/sourceData';

/**
 * path --> log_user_${cur_user_id}
 *
 * 用户 身份表 基准 path
 */
export function get_path_log_db_cur_user_cur_uni_type(cur_info: req_info_type) {
  return `${get_path_log_db_cur_user(cur_info)}_${spacename_type}_${
    cur_info[prop_type_target_id]
  }`;
}

export function log_db_cur_uni_type(cur_info: req_info_type) {
  return log_mongoDB.collection(
    get_path_log_db_cur_user_cur_uni_type(cur_info)
  );
}
